<%@ include file="/WEB-INF/template/include.jsp"%>
<openmrs:require privilege="View Orders" otherwise="/login.htm" redirect="/module/simplelabentry/index.htm" />
<%@ include file="localHeader.jsp"%>

<openmrs:htmlInclude file="/scripts/calendar/calendar.js" />

<br/>
<div style="text-align:center;">
    <b class="boxHeader">Enter Lab Orders</b>
    <div class="box">
        <form action="orderEntry.htm" method="get">
            <spring:message code="simplelabentry.orderLocation" />:
            <openmrs_tag:locationField formFieldName="orderLocation" initialValue=""/>
            <spring:message code="simplelabentry.orderDate" />:
            <input type="text" name="orderDate" size="10" value="" onFocus="showCalendar(this)" />
            <input type="submit" value="<spring:message code="general.submit" />" />
        </form>
    </div>
    <br/><br/>
    <b class="boxHeader">Enter Results</b>
    <div class="box">
        <form action="resultEntry.htm" method="get">
            <b class="boxHeader">Step 1. Choose which results you want to enter:</b>
            <div class="box">
                <br>
                <spring:message code="simplelabentry.orderDate" />:
                <input type="text" name="orderDate" size="10" value="${param.orderDate}" onFocus="showCalendar(this)" />
                Enter Patient ID:
                <input type="text" id="identifier" class="orderField" value="${param.identifier}" name="patientIdentifier" />

                <table>
                    <tr>
                        <td>
                            <div id="cohort_builder_add_filter" style="padding: 4px; width: 100%; float: left;">
                                <div id="cohortSearchTabs">
                                    <ul>
                                        <li>&nbsp;</li>

                                        <c:forEach items="${headingList}" var="tabHeading">
                                            <c:choose>
                                                <li><a id="searchTab_${tabHeading.name}" href="#" onClick="changeSearchTab(this)"><spring:message code="${tabHeading.name}"/></a></li>
                                                <input type="hidden" id="default" name="default" value="searchTab_${tabHeading.name}"/>
                                            </c:choose>
                                        </c:forEach>
                                    </ul>

                                    <div id="cohortSearchTabContent" style="border: 1px black solid; border-top: none; padding: 4px 5px 2px 10px;">

                                        <c:forEach items="${headingList}" var="tabHeading">
                                            <div id="searchTab_${tabHeading.name}_content" style="display: none">

                                                <c:forEach items="${tabHeading.answers}" var="answers">
                                                    <input type="Submit" name="groupKey" value="${answers.answerConcept.name}" onSubmit="this.form.submit()"/>
                                                </c:forEach>

                                            </div>
                                        </c:forEach>
                                    </div>

                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </form>

    </div>
    <br/><br/>
    <b class="boxHeader">Edit/Manage Orders and Results</b>
    <div class="box">
        <form action="existingOrders.htm" method="get">
			Choose From Existing Orders by Category: <simplelabentry:groupedOrderTag name="groupKey" defaultValue="" javascript="" />
            <span> OR </span>
			Patient Identifier: <input type="text" name="identifier" size="10" />
            <input type="submit" value="Submit" />
        </form>
    </div>
</div>

<%@ include file="/WEB-INF/template/footer.jsp"%>
